<?php

yii::import('gii.components.TextDiff');

class VersionDiff extends TextDiff
{
	public static function compare($lines1, $lines2)
	{
		if(is_string($lines1))
			$lines1=explode("</p>",$lines1);
		if(is_string($lines2))
			$lines2=explode("</p>",$lines2);
		$diff = new Text_Diff('auto', array($lines1, $lines2));
		$renderer = new Text_Diff_Renderer_inline();
		return $renderer->render($diff);
	}
}